package com.cqcomponents.components;

import org.apache.commons.lang.StringUtils;

import com.cqcomponents.annotations.JcrPropertyInjection;

public class Text extends BaseComponent {
	private String text = "";

	@JcrPropertyInjection
	public void setText(String text) {
		this.text = text;
	}

	@Override
	public boolean getHasContent() {
		return StringUtils.isNotBlank(this.text);
	}

	public String getText() {
		return StringUtils.replace(StringUtils.replace(text, "\r\n", "<br/>"),
				"\n", "<br/>");
	}

	@Override
	public String toString() {
		return "Text={text:" + this.text + "}";
	}

}
